package com.example.demo.utils;

import org.springframework.stereotype.Component;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@Component
public class ReadFileUtils {
	private static ArrayList<String> listname = new ArrayList<String>();
     public static List getAllFileName(String path) {
         ArrayList<String> fileNameList = new ArrayList<String>();
         boolean flag = false;
         File file = new File(path);
         File[] tempList = file.listFiles();

         for (int i = 0; i < tempList.length; i++) {
             if (tempList[i].isFile()) {
//              System.out.println("文     件：" + tempList[i]);
                 //fileNameList.add(tempList[i].toString());
                 fileNameList.add(tempList[i].getName());
             }
         }
         return fileNameList;
     }
}